require 'vim'
include VIM

class LoadError
    def missing_file
        message.scan(/^.*-- (.*)$/) do |a|
            file = a.first
            if not file =~ /.*\.rb$/
                file = file + '.rb' 
            end
            return file
        end
    end
end


class FileMissingHandler
    def handled_error_type
        LoadError
    end

    def on_error_happen(error)
        filename = error.missing_file
        return Tab.create_with_confirm(filename)
    end
end


